﻿@{
    ApproveProcess appPrc = ViewBag.appPrc;
    int refId = ViewBag.refId ?? 0;
    int Related = ViewBag.Related ?? 0;
    string url = null;
}
<!--# Partial detail view of related page -->
@{
    switch (appPrc.AppPrcGrpId) // แยกตามระบบ
    {
        case 1: // ขอลา
            url = Url.Action("Details", "AbsenceAdmin", new {id = refId, nolayout = true, contentOnlyReset = true});
            break;
        case 2: // คำสั่ง
            url = null;
            break;
        case 6: // แจ้งความประสงค์
            url = Url.Action("Details", "PrePurchase", new {id = refId, nolayout = true, contentOnlyReset = true});
            break;
        case 7: // ขอเบิก
            url = Url.Action("Details", "RequestParcel", new {id = refId, nolayout = true});
            break;
        case 8: // ขอซื้อขอจ้าง
            url = Url.Action("Details", "Purchase", new {id = refId, nolayout = true});
            break;
        case 10: // ใบสั่ง PO-Purchase
            url = Url.Action("Details", "PurchaseOrder", new {id = refId, nolayout = true});
            break;
        case 13: // สัญญา PO-Contract
            url = Url.Action("Details", "PurchaseOrder", new {id = refId, nolayout = true});
            break;
        case 12: // ประกาศ
            url = Url.Action("Details", "Bid", new {id = refId, nolayout = true, Related});
            break;
        case 14: // ตรวจรับ
            url = Url.Action("Details", "DeliveryNote", new {DnId = refId, nolayout = true});
            break;
        case 15: // รักษาการณ์
            url = Url.Action("Details", "WorkOnDuty", new {id = refId});
            break;
        default:
            @: ไม่ทราบเนื้อหาที่เกี่ยวข้อง[รหัสประเภทการอนุมัติ(AppPrcId) = @appPrc.AppPrcId, รหัสระบบการอนุมัติ(AppPrcGrpId) = @appPrc.AppPrcGrpId]
            break;
    }

    Session["Url1"] = url;
}